From 8f80992b9bcade686069b6be6aa0d9b61def8131 Mon Sep 17 00:00:00 2001 From: htrex Date: Wed, 29 Jul 2026 11:51:52 +0200 Subject: [PATCH] search: Do not unregister a provider that was not registered If the passed provider is not in this._providers, indexOf() returns -1 and splice(-1, 1) silently removes the LAST provider in the array - an arbitrary, unrelated provider. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9317 Part-of: (cherry picked from commit a4c7d5e60e4f0982f7dfa048b7400eb4fdf2f97e) --- js/ui/search.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/ui/search.js b/js/ui/search.js index 9ded14184..88965bfb6 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -670,6 +670,9 @@ export const SearchResultsView = GObject.registerClass({ _unregisterProvider(provider) { const index = this._providers.indexOf(provider); + if (index < 0) + return; + this._providers.splice(index, 1); if (provider.display) -- 2.39.5